﻿/* ************************************************************
 * Namespace: JumpFleetGameLib.xMap.SectorMap
 * Class:  Tile
 * Author:  Roy Penrod
 * 
 * Base class for all tiles. 
 *  
 * ************************************************************ */

using System;
using Microsoft.Xna.Framework;


namespace JumpFleetGameLib.xMap.SectorMap
{
    public abstract class BackgroundTile
    {
        #region MEMBERS

        // tag to identify the kind of tile it is
        private string _tag;

        // position of the tile on the screen
        private Vector2 _position;

        // width and height of the tile
        private int _width;
        private int _height;

        // layer the tile is located on
        private float _layerDepth;

        // flag for whether the tile is visible
        private bool _visible;

        #endregion


        #region PROPERTIES
        /// <summary>
        /// Tag to identify the kind of background tile.  Type: string
        /// </summary>
        public string Tag
        {
            get { return _tag; }

            set { _tag = value; }
        }
                
        /// <summary>
        /// Position of the background tile on the screen.
        /// </summary>
        public virtual Vector2 Position
        {
            get { return _position; }

            set { _position = value; }
        }

        /// <summary>
        /// Width of the background tile.  Type: int
        /// </summary>
        public int Width
        {
            get { return _width; }
        }

        /// <summary>
        /// Height of the background tile.  Type: int
        /// </summary>
        public int Height
        {
            get { return _height; }
        }

        /// <summary>
        /// Layer depth of the background tile.  Type: float
        /// </summary>
        public virtual float Layer
        {
            get { return _layerDepth; }

            set { _layerDepth = value; }
        }

        /// <summary>
        /// Flag for whether the background tile is visible.  Type: bool
        /// </summary>
        public virtual bool Visible
        {
            get { return _visible; }

            set { _visible = value; }
        }

        #endregion


        #region CONSTRUCTORS     
        

        // Visible defaults to false
        // Position defaults to 0, 0
        
        /// <summary>
        /// Construct for the BackgroundTile class.
        /// </summary>
        /// <param name="tag">Tag to identify the kind of background tile.  Type: string</param>
        /// <param name="tileWidth">Width of the background tile.  Type: int</param>
        /// <param name="tileHeight">Height of the background tile.  Type: int</param>
        /// <param name="tileLayer">Layer depth of the background tile.  Type: float</param>
        public BackgroundTile(string tag, int tileWidth, int tileHeight, float tileLayer)
        {
            // assigns the parameters
            _tag = tag;            
            _width = tileWidth;
            _height = tileHeight;
            _layerDepth = tileLayer;
            
            // sets the Visible flag to false
            _visible = false;

            // sets the Position to a default of 0, 0
            _position = new Vector2(0, 0);
        }

        #endregion


        #region METHODS      
        #endregion

    } // <-- end class
} // <-- end namespace
